package com.woniu.userservice.dao;


import com.woniu.userservice.entity.Account;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AccountDao {
    Account queryById(Integer id);

    List<Account> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
    
    List<Account> findAll();

    List<Account> queryAll(Account account);

    int insert(Account account);

    int update(Account account);

    int deleteById(Integer id);
    /**
    *@Author:huangjing
    *@Description:
    *@Date: 10:34 2020/3/24
    */
    @Select("select COUNT(id)  from account where" +
            " DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= createTime " +
            "AND createTime<CURDATE()  group by DATE_FORMAT(createTime,\"%Y%m%d\") ")
    List<Integer> queryCountByTime();

    Account queryByAccount(String account);
}